Skip to content

pkgs/id crate split step 4: extract id-groups (#4407) - #8754

Merged
dezren39 merged 1 commit into
mainfrom
crate-split-step4-id-groups
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
crate-split-step4-id-groups

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Step 4 of the pkgs/id crate split (#3447 umbrella; design doc/2026-11-01T16-53-00Z_design_id_crate_split). One PR, branch crate-split-step4-id-groups, worktree on the laptop.

What moved (implementation exists only in id-groups now)

New workspace crate pkgs/id/crates/id-groups (deps per the design map: id-core, id-store, id-events), containing the policy/enforcement remainder over id-events' group projection — the step-2b ruling on #4405 stands: the group model/fold/policy/friendship live in id-events and do not move again; membership/access already live in id-core; pull_policy in id-events.

  • groups remainder: actions.rs, log.rs (GroupLog), warnings.rs. id_groups::groups re-exports the id_events::groups model at the same paths, so the moved files' super::/crate::groups references resolve unchanged. The dead pub(crate) use id_events::groups::wire; re-export in log.rs (no consumer at HEAD) is dropped. groups/worlds.rs does not move (seam 6 → id-worlds, step 5): the facade src/groups/ now holds only the shim mod.rs + worlds.rs, and the shim re-exports actions/log/warnings from id-groups — step 5's extraction of worlds.rs is a straight lift from there.
  • encryption/: whole module (scheme 883, history, notice, ordering, roster, welcome, tests 2,850).
  • blob_gate gate logic: BlobPolicy, Request, decide, decide_with_blocks, blob_events/blob_events_with_blocks, and the WorldAccess re-export (trait itself stays in id-events, step 2b).

Facade paths id::groups::*, id::encryption, id::blob_gate keep compiling unchanged. The facade's now-unused p2panda-encryption dependency moves to id-groups with identical features.

Seam 5 resolution (encryption → world_session)

Already cut by step 3a: MAX_FRAME_BYTES is defined in id_core::frames (pub const MAX_FRAME_BYTES: usize = 1024 * 1024); the facade's world_session only re-exports it. The actual leak in the moved code was encryption/welcome.rs (and one test line) naming it through crate::world_session; both now name id_core::frames::MAX_FRAME_BYTES — same constant, same value, no relocation needed and no behaviour change. Also: scheme.rs/tests name id_core::rejection::Reason; history.rs names id_store::policy::History (its defining home since step 2a).

blob_gate treatment (split, mirroring step 2a's store_traits pattern)

FoldedWorlds — the WorldAccess impl over groups::worlds::Worlds — genuinely needs the world-fold type, which is step 5 (above id-groups). So the gate moved and the world-folding adapter stayed in the facade src/blob_gate.rs (189 lines: re-exports + FoldedWorlds + its four folded tests), positioned to move together with worlds.rs in step 5. The gate's table/proptest tests moved with it; the blocked-member test uses a small local BlockList stub in id-groups (the facade's pull_policy::testing stub folds through worlds and cannot live below it).

Verification (laptop; fresh CARGO_TARGET_DIRs — the cargo-target-broker is broken fleet-wide, noted in step 3)

Baseline taken on unmodified main 05354175d2 before any edit:

  • Full cargo test --no-fail-fast stops at a pre-existing compile failure unrelated to this step: tests/probe_attestation_sign.rs E0061 ×2 — sign_claim gained a &GenesisAgreement parameter in f998d27 (landed today) without updating the salvaged probe. Counting run (every target except that probe and the feature-gated dht_testnet): 3,670 passed, 1 failed, 8 ignored, 62 suites; the one failure is the known frames::tests::byte_refusal_does_not_spend_a_frame_token_or_increment_counters (pkgs/id: frames byte_refusal test fails deterministically on main (RequestTooLarge vs BudgetExhausted) #8620; frames now lives in id-core). Doc tests: 19 passed.

After this change:

  • Counting run: 3,670 passed, 1 failed (same test), 8 ignored, 63 suites. Per-suite delta is an exact redistribution: facade lib 2,090 → 1,975 passed (ignored 4 → 3), new id-groups suite 115 passed / 1 ignored; every other suite byte-identical counts. Doc tests 19 passed / 0 failed. Full unfiltered run fails with the identical probe error only.
  • Fuel canary: sha256sum src/sandbox.rs = db88ec8d52e961702353c97a407b77badadef1bd7e0a610a6075267e175d80b5 before and after; print_fuel_baseline output byte-identical (72 lines, sha256 59cfad49c7553c8309a8b40b23405321399bb76bb741acaeb90f78570f45c32c both runs).
  • Feature-shape parity: cargo check -p id --no-default-features and --no-default-features --features world fail on main and on this branch with identical error-location sets (the facade's world modules name gated siblings; these shapes were unsupported before this step), minus one diagnostic on the removed dead log.rs re-export line.
  • Nix: nix build ./pkgs/id#id-lib (no NIX_CONFIG override) — build phase passes; check phase fails on the same pre-existing probe_attestation_sign compile error as main (parity; the known cli_tests::world_new_scaffold_compiles_with_pinned_roc Roc-sandbox failure sits behind that compile error and is unreachable until the probe is fixed upstream).
  • Completeness grep: src/groups/ holds only the shim + worlds.rs; src/encryption.rs is a 14-line re-export; src/blob_gate.rs holds only re-exports + the FoldedWorlds adapter + its tests. All implementations exist only under crates/id-groups/.
  • Moved files are byte-identical to HEAD except the seam rewrites named above (verified by diff per file).

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…_gate, encryption) (#4407)

Step 4 of the pkgs/id crate split (#3447 umbrella, design
doc/2026-11-01T16-53-00Z_design_id_crate_split): the
policy/enforcement remainder of the group layer moves into the new
id-groups workspace crate, over id-events' group projection (step 2b
ruling on #4405: the group model, fold, policy and friendship live in
id-events and do not move again; membership and access already live
in id-core; pull_policy in id-events).

Moved (implementation exists only in id-groups now):
- groups remainder: actions.rs, log.rs (GroupLog), warnings.rs.
  id_groups::groups re-exports the id_events::groups model at the
  same paths, so the moved files' super::/crate::groups references
  resolve unchanged. The dead pub(crate) wire re-export in log.rs
  (no consumer at HEAD) is dropped.
- encryption/ whole module (scheme, history, notice, ordering,
  roster, welcome, tests). Seam 5 turned out already cut by step 3a:
  MAX_FRAME_BYTES lives in id_core::frames (world_session only
  re-exports it), so welcome.rs and tests.rs name
  id_core::frames::MAX_FRAME_BYTES — same constant, same value
  (1024 * 1024), no behaviour change. scheme.rs/tests.rs name
  id_core::rejection::Reason; history.rs names
  id_store::policy::History, its defining home since step 2a.
- blob_gate gate logic: BlobPolicy, Request, decide,
  decide_with_blocks, blob_events/blob_events_with_blocks and the
  WorldAccess re-export. Split, mirroring step 2a's store_traits
  pattern: FoldedWorlds (the WorldAccess implementation over
  groups::worlds::Worlds) stays in the facade with worlds.rs —
  worlds is step 5, above id-groups — together with its four folded
  tests, so step 5 moves FoldedWorlds and worlds.rs together. The
  gate's table/proptest tests move; the blocked-member test uses a
  small local BlockList stub (the facade's pull_policy::testing
  stub folds through worlds and cannot live below it).

Facade: id::groups::* (shim keeps worlds.rs local plus re-exports
from id_groups and id_events), id::encryption and id::blob_gate
paths all keep compiling unchanged. The facade's now-unused
p2panda-encryption dependency moves to id-groups with the same
features. id-groups deps per the design map: id-core, id-store,
id-events.

Verification (laptop, fresh CARGO_TARGET_DIRs; the cargo-target
broker is broken fleet-wide):
- Baseline on unmodified main (0535417) first: full
  cargo test --no-fail-fast stops at a pre-existing compile failure
  in tests/probe_attestation_sign.rs (E0061 x2, sign_claim gained a
  &GenesisAgreement parameter in f998d27 today without updating
  the salvaged probe). Counting run (all targets except that probe
  and the feature-gated dht_testnet): 3,670 passed, 1 failed
  (frames::tests::byte_refusal_..., the known #8620 failure, frames
  now in id-core), 8 ignored, 62 suites; doc tests 19 passed.
- After: identical counts — 3,670 passed, 1 failed (same test),
  8 ignored; suites 63 (facade lib 2,090 -> 1,975 passed, new
  id-groups suite 115 passed, ignored 4 -> 3 + 1: exact
  redistribution, no test lost). Doc tests 19 passed, 0 failed.
  Full unfiltered run fails with the identical probe error only.
- Fuel canary: sha256 src/sandbox.rs db88ec8d...80b5, unchanged;
  print_fuel_baseline output byte-identical (72 lines, sha256
  59cfad49...32c both runs).
- Feature-shape parity: --no-default-features and
  --no-default-features --features world checks fail on main and
  here with identical error location sets (facade world modules
  name gated siblings; unsupported shapes before this step too),
  minus the one diagnostic on the removed dead log.rs re-export.
- Nix: nix build ./pkgs/id#id-lib — build phase passes; check
  phase fails on the same pre-existing probe_attestation_sign
  compile error as main (parity; the known cli_tests Roc-sandbox
  failure behind it is unreachable until that probe is fixed
  upstream).
@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 18:14
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9e5ada75-e36d-4da5-a310-e08626892c84
Commits

Reviewing files that changed from the base of the PR and between 0550ca7 and 965984f.

Files ignored due to path filters: 1

  • pkgs/id/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 19

  • pkgs/id/Cargo.toml
  • pkgs/id/crates/id-groups/Cargo.toml
  • pkgs/id/crates/id-groups/src/blob_gate.rs
  • pkgs/id/crates/id-groups/src/encryption/history.rs
  • pkgs/id/crates/id-groups/src/encryption/mod.rs
  • pkgs/id/crates/id-groups/src/encryption/notice.rs
  • pkgs/id/crates/id-groups/src/encryption/ordering.rs
  • pkgs/id/crates/id-groups/src/encryption/roster.rs
  • pkgs/id/crates/id-groups/src/encryption/scheme.rs
  • pkgs/id/crates/id-groups/src/encryption/tests.rs
  • pkgs/id/crates/id-groups/src/encryption/welcome.rs
  • pkgs/id/crates/id-groups/src/groups/actions.rs
  • pkgs/id/crates/id-groups/src/groups/log.rs
  • pkgs/id/crates/id-groups/src/groups/mod.rs
  • pkgs/id/crates/id-groups/src/groups/warnings.rs
  • pkgs/id/crates/id-groups/src/lib.rs
  • pkgs/id/src/blob_gate.rs
  • pkgs/id/src/encryption.rs
  • pkgs/id/src/groups/mod.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T18:16:24.394266Z 965984f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant